lang/perl: Filter -g3 in TARGET_CFLAGS
authorMarcel Denia <[email protected]>
Mon, 21 Jul 2014 01:16:27 +0000 (03:16 +0200)
committerMarcel Denia <[email protected]>
Mon, 21 Jul 2014 01:29:17 +0000 (03:29 +0200)
-g3 will make the build fail in Compress-Raw-Zlib with
  ld: final link failed: Memory exhausted
This bug is actually documented[1] and fixed by filtering that flag. Since
we're passing CFLAGS manually, we need to do the same to make things work.
I suspect that this is actually a linker or library bug, but for now let's
just replicate the official fix.

[1] https://rt.cpan.org/Public/Bug/Display.html?id=88936

Signed-off-by: Marcel Denia <[email protected]>
lang/perl/Makefile

index 4fdc6628bedc4164c70720f7d666fa62022738dd..4b07cc947b7baf11baf27fdc374e2c1073f5c504 100644 (file)
@@ -39,6 +39,9 @@ ifneq ($(CONFIG_USE_EGLIBC),)
        EXTRA_LIBS:=bsd
        EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
 endif
+# Filter -g3, it will break Compress-Raw-Zlib
+TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
+TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
@@ -72,7 +75,7 @@ endef
 define Build/Configure
        sed \
                -e 's!%%CC%%!$(TARGET_CC)!g' \
-               -e 's!%%CFLAGS%%!$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)!g' \
+               -e 's!%%CFLAGS%%!$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)!g' \
                -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
                -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
                -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \